package com.yunji.product.provide;

import cn.hutool.core.lang.Pair;
import com.yunji.common.model.cache.ProductBelongCacheDTO;
import com.yunji.product.bo.ProductSelectQueryBO;
import com.yunji.product.business.ProductBusiness;
import com.yunji.product.service.IProductService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class ProductProvide {

    @Resource
    private IProductService productService;

    @Resource
    private ProductBusiness productBusiness;

    public ProductBelongCacheDTO covertCellPrice(Long productId, Long belongId) {
        return productService.selectProductPrice(ProductSelectQueryBO.builder().productId(productId).belongId(belongId).build());
    }

//    public List<CabinetCellBO> getProductListById(Long cabinetId, Long belongId) {
//        return productBusiness.getProductListById(cabinetId, belongId);
//    }

    public ProductBelongCacheDTO selectProduct(ProductSelectQueryBO bo) {
        return productService.selectProductPrice(bo);
    }

    public Pair<String, String> getProductNameAndPics(Long productId) {
        return productService.getProductNameAndPics(productId);
    }
}
